-
Notifications
You must be signed in to change notification settings - Fork 281
Documentation for self-hosting with docker compose #855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
48a9bc4
to
ae27df7
Compare
Signed-off-by: unteem <[email protected]> f
Signed-off-by: unteem <[email protected]>
Signed-off-by: unteem <[email protected]>
ae27df7
to
3531bf4
Compare
docker compose pull | ||
``` | ||
|
||
### Step 3: Restart yout containers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yout
location /collaboration-auth { | ||
proxy_pass http://docs_backend/api/v1.0/documents/collaboration-auth/; | ||
proxy_set_header X-Forwarded-Proto https; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Original-URL $request_uri; | ||
|
||
# Prevent the body from being passed | ||
proxy_pass_request_body off; | ||
proxy_set_header Content-Length ""; | ||
proxy_set_header X-Original-Method $request_method; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need this anymore as mentioned here. I am not sure if we still need /media-auth
or not. I've managed to spin up docs
with traefik
without these two /collaboration-auth
and /media-auth
with socket connection and real time collaboration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you commits does not have a description. It is useful to add it to explain why you made the modification about the env.md
file for example.
location /collaboration/ws/ { | ||
# Ensure WebSocket upgrade | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "Upgrade"; | ||
|
||
# Collaboration server | ||
proxy_pass http://y-provider:4444; | ||
|
||
# Set appropriate timeout for WebSocket | ||
proxy_read_timeout 86400; | ||
proxy_send_timeout 86400; | ||
|
||
# Preserve original host and additional headers | ||
proxy_set_header X-Forwarded-Proto https; | ||
proxy_set_header Origin $http_origin; | ||
proxy_set_header Host $host; | ||
} | ||
|
||
location /collaboration-auth { | ||
proxy_pass http://docs_backend/api/v1.0/documents/collaboration-auth/; | ||
proxy_set_header X-Forwarded-Proto https; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Original-URL $request_uri; | ||
|
||
# Prevent the body from being passed | ||
proxy_pass_request_body off; | ||
proxy_set_header Content-Length ""; | ||
proxy_set_header X-Original-Method $request_method; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this part, it has been removed in the main branch, it is not used anymore.
curl -o compose.yaml https://raw.githubusercontent.com/suitenumerique/docs/refs/heads/main/docs/examples/compose/nginx-proxy/compose.yaml | ||
``` | ||
|
||
### Step 2: Edit `DEFAULT_EMAIL` in the compose file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no description for this step 2.
|
||
### Step 2: Edit `DEFAULT_EMAIL` in the compose file. | ||
|
||
### Create docker network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing step 3
docker compose pull | ||
``` | ||
|
||
### Step 3: Restart yout containers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before restarting the containers you should suggest to read the UPGRADE.md
file.
DOCS_HOST=docs.domain.tld | ||
KEYCLOAK_HOST=id.domain.tld | ||
S3_HOST=storage.domain.tld | ||
MINIO_HOST=storage.domain.tld |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is MINIO_HOST used?
POSTGRES_PASSWORD=<generate postgres password> | ||
PGDATA=/var/lib/postgresql/data/pgdata | ||
|
||
# Keyclaok postgresql configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keyclaok
|
||
```bash | ||
mkdir -p docs/env.d | ||
curl -o compose.yaml https://raw.githubusercontent.com/suitenumerique/docs/refs/heads/main/docs/examples/compose.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you put the compose.yaml in a different directory than docs/examples/compose.yaml
curl -o compose.yaml https://raw.githubusercontent.com/suitenumerique/docs/refs/heads/main/docs/examples/compose.yaml | ||
curl -o env.d/common https://raw.githubusercontent.com/suitenumerique/docs/refs/heads/main/docs/env.d/production.dist/common | ||
curl -o env.d/backend https://raw.githubusercontent.com/suitenumerique/docs/refs/heads/main/docs/env.d/production.dist/backend | ||
curl -o env.d/yprovider https://raw.githubusercontent.com/suitenumerique/docs/refs/heads/main/docs/env.d/production.dist/yprovider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing env.d/postgresql?
1. Navigate to the "Clients" tab. | ||
2. Click on the "Create client" button. | ||
3. Enter the client ID - e.g. `docs`. | ||
4. Enable "Client authentification" option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Client authentication
env_file: | ||
- env.d/backend | ||
- env.d/postgresql | ||
- env.d/common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe common needs to come before backend, otherwise you get errors like this
WARN[0000] The "DOCS_HOST" variable is not set. Defaulting to a blank string.
WARN[0000] The "DOCS_HOST" variable is not set. Defaulting to a blank string.
WARN[0000] The "S3_HOST" variable is not set. Defaulting to a blank string.
|
||
```bash | ||
docker compose run --rm app python manage.py migrate | ||
docker compose run --rm app python manage.py createsuperuser --email <admin email> --password <admin password> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"app" should be "backend"? also at the bottom of this file
|
||
Replace `<admin email>` with the email of your admin user and generate a secure password. | ||
|
||
Your docs instance is now avalailable on the domain you defined, https://docs.yourdomain.tld. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avalailable
# - VIRTUAL_PORT=8083 # used by nginx proxy | ||
# - LETSENCRYPT_HOST=${DOCS_HOST} # used by lets encrypt to generate TLS certificate | ||
volumes: | ||
- ./default.conf.template:/etc/nginx/templates/default.conf.template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think /docker-entrypoint.d/20-envsubst-on-templates.sh
is never run so the template never becomes a proper config.
The upstream nginx container uses ENTRYPOINT ["/docker-entrypoint.sh"]
which should call this but this is overwritten in the lasuite/impress-frontend
image to /usr/local/bin/entrypoint
Am I missing something?
Purpose
Make self hosting of Docs easier with an example of a deployment procedure with docker compose and document how to configure Docs.
While #583 propose an easy way to deploy Docs with docker and Make, here we describe more in details the various steps and requirements to deploy Docs.
Proposal
Improvements
Fixes #561
Supersedes #583
A one liner quick start could be a nice addition: